package com.example.cloudmusicserve.util;

import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;

/**
 * @description: HttpClient
 * @author: xiaoyuan
 * @time: 2023/5/24
 */
@Service
public class HttpClient {

    public  String client(String url, HttpMethod method, MultiValueMap<String,String> params){
        RestTemplate template = new RestTemplate();
        ResponseEntity<String> res = template.getForEntity(url,String.class);
        return  res.getBody();
    }
}

